package com.itcam.designmodule_.singleton;


/**
 * Author:Cammy.Wu
 * Date:2024-05-29
 * Description: 静态内部类实现单例
 * <p>
 * TODO:只要是单例模式一定要构造器私有
 */

// 静态内部类实现
public class Holder {
    private Holder() {
    }

    public static Holder getInstance() {
        return InnerClass.HOLDER;
    }

    public static class InnerClass {
        private static final Holder HOLDER = new Holder();
    }
}
